#include "input_manager.hpp"
using namespace std;

InputManager * InputManager::getInputManager()
{
    if ( __handle != nullptr )
    {
        return __handle.get();
    }
    else
    {
        __handle.reset( new InputManager() );
        return __handle.get();
    }
}

std::shared_ptr<InputManager> InputManager::__handle;

void InputManager::getInput()
{
    if ( !SDL_PollEvent( &input ) ) return;
    switch ( input.type )
    {
    case SDL_QUIT:
        //game.exit();
        break;
    case SDL_MOUSEMOTION:
        //input.motion.x /= game.view->scale.x;
        //input.motion.y /= game.view->scale.y;
        break;
    case SDL_MOUSEBUTTONDOWN:
    case SDL_MOUSEBUTTONUP:
        //input.motion.x /= game.view->scale.x;
        //input.motion.y /= game.view->scale.y;
        break;
    }
}